A New Algorithm to Represent a Given k-ary Tree into Its Equivalent Binary Tree Structure
نویسندگان
چکیده
In this paper we have developed an algorithm that converts a given k-ary tree, for any k ≥ 3, to its equivalent binary tree structure. The binary tree is generated in O(n) time, for a k-ary tree with a total of n nodes. The algorithm is designed aiming at reducing the height of the constructed binary tree. The constructed tree does not contain any free links in the non-leaf nodes. That means the constructed tree is like a complete binary tree, where only leaves have no children, and nodes other than leaf nodes contain child (children) and some other valid information of the given k-ary tree.
منابع مشابه
An improved algorithm to reconstruct a binary tree from its inorder and postorder traversals
It is well-known that, given inorder traversal along with one of the preorder or postorder traversals of a binary tree, the tree can be determined uniquely. Several algorithms have been proposed to reconstruct a binary tree from its inorder and preorder traversals. There is one study to reconstruct a binary tree from its inorder and postorder traversals, and this algorithm takes running time of...
متن کاملAn improved algorithm to reconstruct a binary tree from its inorder and postorder traversals
It is well-known that, given inorder traversal along with one of the preorder or postorder traversals of a binary tree, the tree can be determined uniquely. Several algorithms have been proposed to reconstruct a binary tree from its inorder and preorder traversals. There is one study to reconstruct a binary tree from its inorder and postorder traversals, and this algorithm takes running time of...
متن کاملA novel algorithm to determine the leaf (leaves) of a binary tree from its preorder and postorder traversals
Binary trees are essential structures in Computer Science. The leaf (leaves) of a binary tree is one of the most significant aspects of it. In this study, we prove that the order of a leaf (leaves) of a binary tree is the same in the main tree traversals; preorder, inorder, and postorder. Then, we prove that given the preorder and postorder traversals of a binary tree, the leaf (leaves) of a bi...
متن کاملParallel Generation of t-ary Trees
A parallel algorithm for generating t-ary tree sequences in reverse B-order is presented. The algorithm generates t-ary trees by 0-1 sequences, and each 0-1 sequences is generated in constant average time O(1). The algorithm is executed on a CREW SM SIMD model, and is adaptive and cost-optimal. Prior to the discussion of the parallel algorithm a new sequential generation with O(1) average time ...
متن کاملOn Integer Sequences Derived from Balanced k-ary trees
This article investigates numerous integer sequences derived from two special balanced k-ary trees. Main contributions of this article are two fold. The first one is building a taxonomy of various balanced trees. The other pertains to discovering new integer sequences and generalizing existing integer sequences to balanced k-ary trees. The generalized integer sequence formulae for the sum of he...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2008